package bancosys.tec.persist.entities.domain;

import java.util.List;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Transient;

import jmine.tec.persist.annotation.Alias;

import org.hibernate.annotations.Filter;
import org.hibernate.annotations.Filters;

import bancosys.tec.persist.bussobj.AuthPersistableBusinessObject;
import bancosys.tec.persist.fieldhistory.FieldHistory;
import bancosys.tec.persist.fieldhistory.HistoryHolder;

/**
 * @created 27/09/2007
 * @author Gustavo Almeida
 */

@Entity
@Alias("FHD")
@Filters({ @Filter(name = "authFilter", condition = "auth = :auth") })
@FieldHistory
public class FieldHistoryDummy extends AuthPersistableBusinessObject {
    private Long id;

    private HistoryHolder<Long> valorHistory = new HistoryHolder<Long>();

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    public Long getId() {
        return this.id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public void setValor(Long valor) {
        this.valorHistory.setValue(valor);
    }

    public Long getValor() {
        return this.valorHistory.getValue();
    }

    @Transient
    public List<Long> getValorHistorico() {
        return this.valorHistory.getHistory();
    }
}